package com.tts.superstar.Database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by Administrator on 2019/4/12.
 */

public class BookDatabase extends SQLiteOpenHelper {
    private static final String SQLWords = "create table book(" +
            "_id integer primary key autoincrement," +
            "name varchar(20)," +
            "imgUrl varchar(100))";
    public BookDatabase(Context context) {
        super(context, "my.db", null, 5);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(SQLWords);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL("drop table book");
        db.execSQL(SQLWords);
    }
}
